﻿using NHibernate;

namespace NHibData.SessionManager
{
    /// <summary>
    /// Provide access to the items, stored in HttpContext.Current.Items
    /// </summary>
    public interface INHibenraneSessionManager
    {
        /// <summary>
        /// Get or set default nhibernate session
        /// </summary>
        ISession NHibernateSession { get; set; }

        /// <summary>
        /// Get session by key
        /// </summary>
        /// <param name="nHibernareConfigName">key - nhibernate config file</param>
        /// <returns></returns>
        ISession GetSessionByKey(string nHibernareConfigName);
        
        /// <summary>
        /// Set session by key
        /// </summary>
        /// <param name="nHibernareConfigName">key - nhibernate config file</param>
        /// <param name="session">NHibernateSession</param>
        void SetSessionByKey(string nHibernareConfigName, ISession session);
    }
}